perm filename TSTSER.MID[NET,MRC]2 blob sn#347770 filedate 1978-04-07 generic text, type C, neo UTF8
COMMENT āŠ—   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	TITLE TSTSER
C00004 ENDMK
CāŠ—;
TITLE TSTSER
SUBTTL Definitions

; Mark Crispin, SU-AI, April 1978

; Assembly switches

IFNDEF SVRSKT,SVRSKT==23		; default listen socket
IFNDEF PDLLEN,PDLLEN==50		; stack length

; AC definitions.  0→3 are used by NETWRK

X=4 ? A=5 ? B=6 ? P=17

PDL:	BLOCK PDLLEN			; stack

TSTSER:	JFCL
	RESET
	MOVE ['TSTSER]
	SETNAM
	MOVE P,[PDL(-PDLLEN)]
	MOVEI [DEBREAK ? JRST SUICID]
	MOVEM JOBAPR
	CLKINT 5.*60.*60.		; must die if around too long
	OUTSTR [ASCIZ/TSTSER started
/]

; Listen for a connection on our socket

	MOVEI SVRSKT
	MOVEM LSNSKT
	PUSHJ P,LISTEN
	MOVEI 5,<" >
ECHLUP:	TRZE 5,200
	 JRST .-2
	MOVEI (5)
	PUSHJ P,NETOCH			; send character to user
	AOJA 5,ECHLUP

SUICID:	RESET ? EXIT

...LIT:	CONSTANTS

; Wonderful network routines

SVRRTS==-1				; include server routines
ERRTNS==-1				; include error routines
ERRHAN==-1				; include automagic error handling
ERRINS==<JRST SUICID>			; error instruction

.INSRT NETWRK[NET,MRC]

END TSTSER